package com.chapter01exercise.homework05;

/**
 * @Author 小闽
 * @Date 2024/8/16 10:15
 * @PackageName: com.chapter01exercise.homework5
 * @ClassName: Homework05
 * @Description: 练习5
 * @Version 1.0
 */
public class Homework05 {
    /**
     * 设计父类——员工类。子类：工人类（Worker）,农民类（Peasant）,教师类（Teacher）,
     * 科学家类（Scientist）,服务生类（Waiter）.
     * （1）其中工人，农民，服务生只有基本工资。
     * （2）教师除基本工资外，还有课酬（元/天）。
     * （3）科学家除基本工资外，还有年终奖。
     * （4）编写一个测试类，将各种类型的员工的全年工资打印出来。
     */
    public static void main(String[] args) {
        /**
         * 工人对象工资
         */
        Worker worker = new Worker("张三",3000);
        worker.setSal_month(15);
        System.out.println(worker.countAnnualSalary());
        /**
         * 农民对象工资
         */
        Peasant peasant = new Peasant("马云", 10000);
        peasant.setSal_month(13);
        System.out.println(peasant.countAnnualSalary());
        /**
         * 服务生对象工资
         */
        Waiter waiter = new Waiter("马化腾",20000);
        System.out.println(waiter.countAnnualSalary());
        /**
         * 教师对象工资
         */
        Teacher teacher = new Teacher("陈晓燕", 30000);
        teacher.setLessonRemuneration(1000);
        teacher.setLessonDays(365);
        teacher.setSal_month(14);
        System.out.println(teacher.countAnnualSalary());
        /**
         * 科学家对象工资
         */
        Scientist scientist = new Scientist("钱学森",20000);
        scientist.setAnnualSalary(10000);
        scientist.setSal_month(13);
        System.out.println(scientist.countAnnualSalary());
    }
}

